package com.xyzh05.dao.hibernate;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.xyzh05.dao.PricingDao;
import com.xyzh05.model.Pricing;

@Repository("pricingDao")
public class PricingDaoHibernate extends GenericDaoHibernate<Pricing, Long> implements PricingDao {

    public PricingDaoHibernate() {
        super(Pricing.class);
    }

	public Pricing getPByEditorAService(Long long1, Long long2) {
		
		List <Pricing> ps = this.getHibernateTemplate().find("from Pricing p where p.user.id =? and p.service.id= ?" , new Object []{long1 ,long2}); 
		
		if (ps!=null &&ps.size()>0){
			return ps.get(0);
		}else{
			return null ; 
		}
	}
}
